package com.lxz.bookmanager.service.impl;

import com.lxz.bookmanager.entity.User;
import com.lxz.bookmanager.mapper.UserMapper;
import com.lxz.bookmanager.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    /**
     * 获取用户名
     * @param username
     * @return
     */
    @Override
    public User getUserByUsername(String username) {
        return userMapper.getUserByUsername(username);
    }

    /**修改密码
     *
     * @param username
     * @param newPassword
     */
    @Override
    public void changePassword(String username, String newPassword) {
        userMapper.changePassword(username, newPassword);
    }

    /**
     * 获取密码
     * @param username
     * @return
     */
    @Override
    public String getPassword(String username) {
        return userMapper.getPassword(username);
    }
}
